﻿
using Demo.GIS.GadgetServices.ApiModels;

using GCC.APIContainer.Utilities;
using GCC.Container.Abstracts;
using GCC.Container.Models;

using Microsoft.AspNetCore.Mvc;

namespace Demo.GIS.GadgetServices
{
    [ApiController]
    [Route("GadgetServer")]
    public class GadgetServer : GCCAPIControllerBase
    {
        public GadgetServer(AbsGCCContext context) : base(context)
        {
        }

        [HttpPost("Save")]
        public DataResponse<bool> SaveGadgetInfo([FromBody] SaveGadgetInfoRequest request)
        {
            return HandleData(GadgetServerManager.SaveGadgetInfo(request));
        }
        [HttpGet("search")]
        public DataResponse<SearchGadgetInfoResponse> SearchGadgetInfo(
            [FromQuery] string topLeft,
            [FromQuery] string topRight,
            [FromQuery] string bottomRight,
            [FromQuery] string bottomLeft
            )
        {

            return HandleData(GadgetServerManager.SearchGadgetInfo(topLeft, topRight, bottomRight, bottomLeft));
        }

    }
}
